package org.sy.lab.多线程基础._4_执行器._1_创建线程池._3_newSingleThreadExecutor;

import java.util.concurrent.TimeUnit;

public class MyThread implements Runnable {
	
	private String name;
	
	public MyThread(String name) {
		this.name = name;
	}
	
	@Override
	public void run() {
		
		System.out.println(Thread.currentThread().getName() + "开始执行" + name);
		try {
			TimeUnit.SECONDS.sleep(1);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(Thread.currentThread().getName() + "执行结束");
	}
}
